package com.wkck.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wkck.domain.LoginUser;
import com.wkck.mapper.LoginUserMapper;
import com.wkck.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LoginServiceImpl extends ServiceImpl<LoginUserMapper, LoginUser> implements LoginService {

    @Resource
    private LoginUserMapper loginUserMapper;


    /**
     * 检测用户是否存在
     * @param loginUser
     * @return
     */

    @Override
    public boolean existUser(LoginUser loginUser) {
        return loginUserMapper.existUser(loginUser) != null;
    }

    /**
     * 判断密码是否正确
     * @param loginUser
     * @return
     */

    @Override
    public boolean checkUserPassword(LoginUser loginUser) {
        return loginUserMapper.checkUserPassword(loginUser) != null;
    }


    @Override
    public LoginUser getMsgByUserName(String username) {
        return loginUserMapper.getMsgByUserName(username);
    }
}
